<%--
  Created by IntelliJ IDEA.
  User: 39504
  Date: 2020/3/3
  Time: 18:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="icon" href="../../favicon.ico">

    <title>Signin Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="css/signin.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="../../assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="https://code.jquery.com/jquery-latest.js"></script>
    <script>
        function getUsername() {
            var name=document.getElementById("inputEmail").value;
            $.ajax({
                type:"GET",
                url:"getlogin",
                data:"name="+name,
                dataType:"json",
                async:true,
                success:function (data) {
                    $("#div1").find(".abc").remove();
                    if (data.isRight){
                    $("#div1").append("<span class='abc'>输入正确</span>");
                }else {
                    $("#div1").append("<span class='abc'>输入错误</span>");
                }
                }

            })
        }
    </script>
</head>
<body>

<div class="container">
    <!-- action="user/login"  连接服务端的资源（servlet的映射地址）   -->
    <form class="form-signin" method="post" action="http://localhost:8080/WebDemoMVC/user/login">
        <h2 class="form-signin-heading">Please sign in</h2>
       <div id="div1"> <label for="inputEmail" class="sr-only">Email address</label>
           <input type="text" onblur="getUsername(this)" id="inputEmail" name="username" class="form-control" placeholder="Email address" required autofocus>
       </div>
        <div> <label for="inputPassword"  class="sr-only">Password</label>
            <input type="password" id="inputPassword" name="password" class="form-control" placeholder="Password" required>
        </div>

        <div class="checkbox">
            <label>
                <input type="checkbox" value="remember-me"> Remember me
            </label>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
    </form>

</div> <!-- /container -->


<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>
